#ifndef COVERLORD_H_INCLUDED
#define COVERLORD_H_INCLUDED

#define MAX_MINION 3

#include "LON.h"

#include "CNetworkIO.h"

class CMinion;

enum OVERLORD_TYPE
{
  OLT_DEFENDER,
  OLT_ATTACKER,
  OLT_CASTER,
  OLT_COUNT
};

enum OVERLORD_RANK_TITLE
{
  ORT_NEWCOMER,
  ORT_CHAMPION,
  ORT_VANQUISHER,
  ORT_FALLEN,
  ORT_NETHER_LORD
};

//!This is actually the Player Details
class COverlord : public CNetworkIO
{
  public:
    //! Constructor
    COverlord();
    COverlord(stringw login, stringw name, u8 type, u16 title, u16 fame);
    explicit COverlord(stringw login);
    explicit COverlord(SColor color);

    //! Destructor
    ~COverlord();

    virtual void netWrite(BitStream &bs);

    virtual void netRead(BitStream &bs);

    //! Minion func
    void addMinion(CMinion*);

    CMinion * getMinion(int index);

    u32 getMinionIndex(int minion_id);

    void removeMinion(int index);

    u32 getMinionCount()
      { return vMinion.size(); }

    //! Sets
    void setID (u32 ID);

    void setPassword(stringw &password);

    void setTeamColor(SColor color);

    void set_win(u32 win) { win_ = win; }

    void set_lose(u32 lose) { lose_ = lose; }

    //! Gets
    SColor getTeamColor();

    u32 getID ();

    stringw getLogin();

    stringw getName();

    u8 getType();

    u16 getTitle();

    u16 getFame();

    u32 player_id() { return player_id_; }

    u32 win() { return win_; }

    u32 lose() { return lose_; }

    //! New Login function
    static COverlord* playerLogin(const char *username, const char *password);

  private:
    vector <CMinion *> vMinion;

    SColor teamColor;

    u32 player_id_;

    u32 ID;

    stringw login;

    stringw name;

    stringw password;

    u8 type;

    u16 title;

    u16 fame;

    u32 win_;

    u32 lose_;

};

#endif // COVERLORD_H_INCLUDED
